package part_1;

import java.util.ArrayList;

import genetic_algorithm.Chromosome;

//MonkeyChromosome for GA for the monkey problem
public class MonkeyChromosome extends Chromosome
{

	public String text;
	public static String hamlet_file;
	
	
	public MonkeyChromosome(String text)
	{
		this.text = text;
	}
	
	//return number of characters we got right
	@Override
	public double evaluateFitness() 
	{
		int count=0;
		int length=text.length();
		for(int i=0;i<length;i++)
		{
			//adding to count
			if(text.charAt(i)==hamlet_file.charAt(i))
				count++;
		}
		return count;
	}

	//return the text
	public String toString()
	{
		return text;
	}

	@Override
	public ArrayList<Integer> getData() {
		//no additional data
		return null;
	}
	
	
}
